{extend name="base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-body">
        <form action="{:request()->url()}" class="layui-form" method="post">
            <div class="layui-form-item">
                <label class="layui-form-label">绑定权限</label>
                <div class="layui-input-inline">
                    <select name="auth_id">
                        <option value="">请选择权限</option>
                        {foreach name="auth" item="v"}
                        <option value="{$v.id}" {if condition="isset($data) and $data.auth_id eq $v.id or input('auth_id') eq $v.id"}selected="selected"{/if}>{neq name="v.level" value="1"}|{php}for($i=1;$i<$v['level'];$i++){echo ' ----';}{/php}{/neq} {$v.name}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">是否多级</label>
                <div class="layui-input-block">
                    <input type="radio" name="is_level" value="0" title="否" {if condition="isset($data) and $data.is_level eq '0'"}checked{/if}>
                    <input type="radio" name="is_level" value="1" title="是" {if condition="isset($data) and $data.is_level eq '1'"}checked{/if}>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">是否带图</label>
                <div class="layui-input-block">
                    <input type="radio" name="is_image" value="0" title="否" {if condition="isset($data) and $data.is_image eq '0'"}checked{/if}>
                    <input type="radio" name="is_image" value="1" title="是" {if condition="isset($data) and $data.is_image eq '1'"}checked{/if}>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">类型名称</label>
                <div class="layui-input-inline">
                    <input type="text" name="name" value="{$data.name|default=''}" autocomplete="off" placeholder="请输入名称" lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-filter="i" lay-submit="">保存</button>
                    <button class="layui-btn layui-btn-primary" type="reset">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>
{/block}
